package com.laozhao.deliveryManager.test;

import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.JComboBox;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
import java.awt.BorderLayout;
import javax.swing.JScrollPane;
import javax.swing.table.DefaultTableModel;

public class CreatePanel extends JPanel{
	private JComboBox customerComboBox;
	private JTextField addressField;
	private JTextField sendDateField;
	private JTextField sendNoField;
	public CreatePanel() {
		setLayout(new BorderLayout(0, 0));
		
		JPanel mainDeliveryPanel = new JPanel();
		mainDeliveryPanel.setLayout(null);
		
		JLabel customerNameLabel = new JLabel("收货单位");
		customerNameLabel.setHorizontalAlignment(SwingConstants.RIGHT);
		customerNameLabel.setBounds(10, 8, 60, 14);
		mainDeliveryPanel.add(customerNameLabel);
		
		customerComboBox = new JComboBox();
		customerComboBox.setBounds(80, 5, 165, 20);
		mainDeliveryPanel.add(customerComboBox);
		
		JLabel label = new JLabel("日期");
		label.setHorizontalAlignment(SwingConstants.RIGHT);
		label.setBounds(267, 5, 59, 14);
		mainDeliveryPanel.add(label);
		
		sendDateField = new JTextField();
		sendDateField.setBounds(331, 5, 86, 20);
		mainDeliveryPanel.add(sendDateField);
		sendDateField.setColumns(10);
		
		JLabel addressLabel = new JLabel("收货地址");
		addressLabel.setHorizontalAlignment(SwingConstants.RIGHT);
		addressLabel.setBounds(10, 33, 60, 14);
		mainDeliveryPanel.add(addressLabel);
				
		addressField = new JTextField();
		addressField.setBounds(80, 30, 165, 20);
		mainDeliveryPanel.add(addressField);
		addressField.setColumns(10);		
		
		JLabel sendNoLabel = new JLabel("送货单号");
		sendNoLabel.setHorizontalAlignment(SwingConstants.RIGHT);
		sendNoLabel.setBounds(267, 33, 60, 14);
		mainDeliveryPanel.add(sendNoLabel);
		
		sendNoField = new JTextField();
		sendNoField.setBounds(331, 30, 86, 20);
		mainDeliveryPanel.add(sendNoField);
		sendNoField.setColumns(10);
		
		this.add(mainDeliveryPanel,BorderLayout.CENTER);
		this.add(new JButton("button"), BorderLayout.NORTH);
		
		String[] columnsStrings = new String[]{"no","name"};
		DefaultTableModel model = new DefaultTableModel(columnsStrings,0);
		JTable table = new JTable(model);
		JScrollPane scrollPane = new JScrollPane(table);
//		add(scrollPane, BorderLayout.SOUTH);
	}


}

